package com.it.heima.lei;

import com.it.heima.pojo.Student;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.List;

//这个不懂
@RestController
public class HelloController {
    //Datetimeformat这个注解结构要记住
    //这个是请求的意思
    @RequestMapping("/user")
    public String user(Integer age , String name, @DateTimeFormat(pattern = "yyyy-MM-dd TT:mm:ss")LocalDateTime updateTime){
        System.out.println(age+name+updateTime);
        return "hello user";
    }
    @RequestMapping("/controller")
    public String controller(Student student){
        System.out.println(student);
        return "hello user";
    }
    @RequestMapping("/queryUSer41")
    public String queryUSer41( @RequestParam List<String> subjects){
        System.out.println(subjects);
        return "hello user";
    }
    @RequestMapping("/path/{id}/{phone}")
    public String path(@PathVariable Integer id  ,@PathVariable Integer phone){
        System.out.println(id+" "+phone);
        return "hello user";
    }

}
